package com.star.eastern.blee.utils

class CommandInstance(val command:CommandEnum, val text:String?, val onResponse:((String)->Unit)?, val onError:((Exception?)->Unit)?):Comparable<CommandInstance> {


    override fun compareTo(other: CommandInstance): Int {
        return if(this.command==other.command){
            (this.tm-other.tm).toInt()
        }else{
            if(CommandEnum.STAT==this.command){
                -1
            }else{
                (this.tm-other.tm).toInt()
            }
        }
    }
    private val tm:Long = System.currentTimeMillis()

    override fun toString(): String {
        return "command:$command text:$text ${super.toString()}"
    }
}


